<?php
class Application_Form_Categoria extends Zend_Form
{
    public function init()
    {
        $this->clearDecorators();
        $decorators = array(
            array('ViewHelper'),
            array('Errors'),
            array('Label',array(
                'class' => 'leftalign'
            )),
            array('HtmlTag',array('tag' => 'li'))
        );

        $this->setName('categoria');

        $id = new Zend_Form_Element_Hidden('id');
        $id->addFilter('Int');

        $categoria = new Zend_Form_Element_Text('categoria');
        $categoria->setLabel('Categoria')
            ->setAttrib('size', 50)
            ->setRequired(true)
            ->addFilter('StripTags')
            ->addFilter('StringTrim')
            ->addValidator('NotEmpty');
        $categoria->setDecorators($decorators);

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setAttrib('id', 'submitbutton');
        $submit->setDecorators(array(
            array('ViewHelper'),
            array('HtmlTag',
                array(
                'tag' => 'li',
                'class' => 'submit'))
        ));

        $this->setDecorators(array(
           'FormElements',
            array('HtmlTag',array('tag'=>'ul')),
            array(
                array(
                    'DivTag'=>'HtmlTag'
                ),
                array(
                    'tag'=>'div',
                    'class'=>'FormDiv'
                )
            ),
            'Form'
        ));

        $this->addElements(array($id, $categoria, $submit));

    }


}

